package com.igeek.boot.controller;


import com.igeek.boot.entity.Role;
import com.igeek.boot.result.Result;
import com.igeek.boot.service.IRoleService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jwj
 * @since 2024-01-04
 */
@RestController
@RequestMapping("/wisdom_factory/role")
@Api(tags = "角色表接口")
public class RoleController {

    @Autowired
    private IRoleService roleService;
    //查询所有角色表的信息
    @GetMapping("/findAll")
    public Result findAll(){
        List<Role> roles = roleService.findAll();
        if(!CollectionUtils.isEmpty(roles)){
            return new Result(true,"查询角色表成功",roles);
        }
        return new Result(false,"查询角色表失败");
    }

}
